﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Easycmd
{
    [Obsolete]
    public partial class CopyProcessForm : Form
    {
        int step = 0;
        int total = 0;
        public CopyProcessForm(int totalFiles)
        {
            InitializeComponent();
            total = totalFiles;
            progressBar1.Value = 0;
            progressBar1.Maximum = total;
            Left = 10;
            Top = 10;            
        }

        private void CopyProcessForm_Load(object sender, EventArgs e)
        {
            TopMost = true;
            btnClose.Enabled = false;
            
        }
        public void UpdateProcess(string from ,string to)
        {
            step++;
            label1.Text = string.Format("{0}/{1}",step,total);
            lblFrom.Text = from;
            lblTo.Text = to;
            progressBar1.Value = step;
        }
        CopyCmd copyCmd;

        internal CopyCmd CopyCmd
        {
            get { return copyCmd; }
            set { copyCmd = value; }
        }
        private void Cancel_Click(object sender, EventArgs e)
        {
            if (CopyCmd != null)
            {
                CopyCmd.CancelWork();
                //Close();
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Close();
        }

        internal void SetCloseEnable(bool p)
        {
            btnClose.Enabled = true;
        }

        internal void SetCancelEnable(bool p)
        {
            btnCancel.Enabled = false;
        }
    }
}
